home *** CD-ROM | disk | FTP | other *** search
- property UpCM, DownCM, button_active
-
- on getPropertyDescriptionList
- set description to [:]
- if the currentSpriteNum = 0 then
- set memdefault to 0
- else
- set memref to the member of sprite the currentSpriteNum
- set castLibNum to the castLibNum of memref
- set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
- end if
- addProp(description, #DownCM, [#default: memdefault, #format: #bitmap, #comment: "Pict for Down:"])
- return description
- end
-
- on getBehaviorDescription
- return "Button, auto set up pict, switch pict down"
- end
-
- on getAssocMembers
- set myPropList to [DownCM]
- return myPropList
- end
-
- on beginSprite me
- set the UpCM of me to the member of sprite the spriteNum of me
- set the button_active of me to 0
- puppetSprite(the spriteNum of me, 1)
- end
-
- on endSprite me
- puppetSprite(the spriteNum of me, 0)
- end
-
- on mouseDown me
- set the member of sprite the spriteNum of me to member the DownCM of me
- set the button_active of me to 1
- end
-
- on mouseUp me
- set the member of sprite the spriteNum of me to member the UpCM of me
- set the button_active of me to 0
- end
-
- on mouseUpOutSide me
- set the button_active of me to 0
- end
-
- on mouseLeave me
- if the button_active of me then
- set the member of sprite the spriteNum of me to member the UpCM of me
- end if
- end
-
- on mouseEnter me
- if the button_active of me then
- set the member of sprite the spriteNum of me to member the DownCM of me
- end if
- end
-